package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;

@Getter@Setter
public class TravelQuery extends QueryObject{
    //发布状态
    private int state = -1;
    private Long destId = -1L;
    //公开状态
    private int overt = -1;
    //排序类型  1表示根据时间  2表示根据热度
    private int orderType = -1;
    private int travelTimeType = -1;
    private int perExpendType = -1;
    private int dayType = -1;


    //翻译排序规则
    public String getOrderBy(){
        return orderType == 1 ? "t.releaseTime desc" : "t.viewnum desc";
    }
    //翻译出发时间

    public TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }
    //翻译人均消费
    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PER_EXPEND.get(perExpendType);
    }
    //翻译出行天数
    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }
}
